package com.aifast.system.sys.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Author fujian
 * @since 2022/1/13 11:27
 * 视图跳转控制层
 */
@RequestMapping("view")
@Controller
public class ViewController {

    @Autowired
    private HttpServletResponse response;

    /******************基 础 配 置*****************************************************/
    @GetMapping("index")
    public String index(){
        return "index";
    }

    @GetMapping("ssoLogin")
    public String ssoLogin(){
        return "template/login/sso-login";
    }

    @GetMapping("login")
    public String login() throws IOException {
//        response.sendRedirect("http://localhost:9999/sso/auth?redirect=http://localhost:8099/view/index");
        return "template/login/login";
    }

    @GetMapping("/console/{path}")
    public String console(@PathVariable String path){
        return "console/" + path;
    }

    @GetMapping("/example/{path}")
    public String example(@PathVariable String path){
        return "example/" + path;
    }

    @GetMapping("/tpl/{path}")
    public String tpl(@PathVariable String path){
        return "tpl/" + path;
    }

    @GetMapping("/template/{path}")
    public String template(@PathVariable String path){
        return "template/" + path;
    }

    @GetMapping("/layim/{path}")
    public String aiim(@PathVariable String path){
        return "layim/" + path;
    }

    @GetMapping("/test/{path}")
    public String test(@PathVariable String path){
        return "template/test/" + path;
    }

    /******************基 础 配 置*****************************************************/

    @GetMapping("/module/sys/{path}")
    public String sys(@PathVariable String path){
        return "module/sys/" + path;
    }

    @GetMapping("/module/fd/{path}")
    public String fd(@PathVariable String path){
        return "module/fd/" + path;
    }

    @GetMapping("/module/log/{path}")
    public String log(@PathVariable String path) {
        return "module/log/" + path;
    }

    @GetMapping("/module/gen/{path}")
    public String gen(@PathVariable String path) {
        return "module/gen/" + path;
    }

    @GetMapping("/module/cs/{path}")
    public String order(@PathVariable String path) {
        return "module/cs/" + path;
    }

    @GetMapping("/module/crm/{path}")
    public String seas(@PathVariable String path) {
        return "module/crm/" + path;
    }

    @GetMapping("/module/edu/{path}")
    public String edu(@PathVariable String path) {
        return "module/edu/" + path;
    }

    @GetMapping("/module/vos/{path}")
    public String vos(@PathVariable String path) {
        return "module/vos/" + path;
    }

    @GetMapping("/module/hms/{path}")
    public String hotel(@PathVariable String path) {
        return "module/hms/" + path;
    }

}
